package com.zhou.org.service.impl;

import com.zhou.org.dao.User;
import com.zhou.org.model.CheckResult;
import com.zhou.org.service.LoginCheck;

import java.util.HashMap;
import java.util.Map;

public class TestLoginCheck implements LoginCheck {
    @Override
    public CheckResult login(String userName, String password) {
        CheckResult result = CheckResult.success();
        result.setStatus(1);
        result.setError("用户名或密码错误！");
        Map<String,Object> param = new HashMap<>(2);
        param.put("userName",userName);
        result.setParam(param);
        if("lang.zhou".equals(userName) && "111111".equals(password)){
            result.setStatus(0);
        }
        return result;
    }

    @Override
    public User newUser(CheckResult result) {

        return new User();
    }
}
